import { saveStorage, getStorage, removeStorage } from '@/utils/storage'
const TOKEN_KEY = "TOKEN_KEY"
const state = {
  token: getStorage(TOKEN_KEY) || ''
}
const mutations = {
  saveToken (state, token) {
    state.token = token
    saveStorage(TOKEN_KEY, token)
  },
  logout (state) {
    state.token = ''
    removeStorage(TOKEN_KEY)
  }
}
const actions = {

}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}